\subsection{???}
\begin{definition}
    Let \( \mathfrak p \) be a prime ideal of \( R \).
    The \emph{height} of \( \mathfrak p \), denoted \( \operatorname{ht}(p) \), is
    \[ \operatorname{ht}(\mathfrak p) = \sup \qty{ d \mid \mathfrak p_0 \subsetneq \mathfrak p_1 \subsetneq \dots \subsetneq \mathfrak p_d = \mathfrak p; \mathfrak p_i \in \Spec R } \]
    The \emph{(Krull) dimension} of \( R \) is
    \[ \dim R = \sup \qty{\operatorname{ht}(\mathfrak p) \mid \mathfrak p \in \Spec R} = \sup \qty{\operatorname{ht}(\mathfrak m) \mid \mathfrak m \in \mSpec R} \]
\end{definition}
\begin{remark}
    The height of a prime ideal \( \mathfrak p \) is the Krull dimension of the localisation \( R_{\mathfrak p} \).
    In particular,
    \[ \dim R = \sup \qty{\dim R_{\mathfrak p} \mid \mathfrak p \in \Spec R} = \sup \qty{\dim R_{\mathfrak m} \mid \mathfrak m \in \mSpec R} \]
    So the problem of computing dimension can be reduced to computing dimension of local rings.
\end{remark}
\begin{definition}
    Let \( I \) be a proper ideal of \( R \).
    Then the \emph{height} of \( I \) is
    \[ \operatorname{ht}(I) = \inf \qty{\operatorname{ht}(\mathfrak p) \mid I \subseteq \mathfrak p} \]
\end{definition}
\begin{proposition}
    Let \( A \subseteq B \) be an integral extension of rings.
    Then,
    \begin{enumerate}
        \item \( \dim A = \dim B \); and
        \item if \( A, B \) are integral domains and \( k \)-algebras for some field \( k \), they have the same transcendence degree over \( k \).
    \end{enumerate}
\end{proposition}
We prove part (i); the second part is not particularly relevant for this course.
\begin{proof}
    First, we show that \( \dim A \leq \dim B \).
    Consider a chain of prime ideals \( \mathfrak p_0 \subsetneq \dots \subsetneq \mathfrak p_d \) in \( \Spec A \).
    By the lying over theirem and the going up theorem, we obtain a chain of prime ideals \( \mathfrak q_0 \subseteq \dots \subseteq \mathfrak q_d \) in \( \Spec B \).
    As \( \mathfrak p_i = \mathfrak q_i \cap A \) and \( \mathfrak p_i \neq \mathfrak p_{i+1} \), we must have \( \mathfrak q_i \neq \mathfrak q_{i+1} \).
    So this produces a chain of length \( d \) in \( B \), as required.

    Now consider a chain \( \mathfrak q_0 \subsetneq \dots \subsetneq \mathfrak q_d \) in \( \Spec B \).
    Contracting each ideal, we produce a chain \( \mathfrak p_0 \subseteq \dots \subseteq \mathfrak p_d \) in \( \Spec A \).
    Suppose that \( \mathfrak q_i \) and \( \mathfrak q_{i+1} \) contract to the same prime ideal \( \mathfrak p_i \) in \( \Spec A \).
    Note that \( \mathfrak q_i \subseteq \mathfrak q_{i+1} \), so by incomparability, they must be equal, but this is a contradiction.
\end{proof}
\begin{remark}
    If \( A \) is a finitely generated \( k \)-algebra for some field \( k \), then by Noether normalisation, we obtain a \( k \)-algebra embedding \( k[T_1, \dots, T_d] \to A \), and the extension is integral.
    Thus \( \dim A = \dim k[T_1, \dots, T_d] \).
    One can show that \( \dim k[T_1, \dots, T_d] = d \), and hence that the integer \( d \) obtained by Noether normalisation is uniquely determined by \( A \) and \( k \).
\end{remark}

\subsection{Hilbert polynomials}
Let \( A = \bigoplus_{n \geq 0} A_n \) be a Noetherian graded ring, so \( A_0 \) is Noetherian and \( A \) is finitely generated as an \( A_0 \)-algebra.
Now let \( M = \bigoplus_{n \geq 0} M_n \) be a finitely generated graded \( A \)-module.
Then each \( M_n \) is an \( A_0 \)-module.

We claim that \( M_n \) is finitely generated as an \( A_0 \)-module.
Indeed, \( M = \vecspan_A\qty{m_1, \dots, m_t} \), and the \( m_i \) can be taken to be homogeneous, say, \( m_i \in M_{r_i} \).
Then
\[ M_n = \qty{a_1 m_1 + \dots + a_t m_t \mid a_i \in A_{n-r_i}} \]
Let \( x_1, \dots, x_s \) generate \( A \) as an \( A_0 \)-algebra, where \( x_i \in A_{k_i}, k_i > 0 \).
Then
\[ M_n = \vecspan_{A_0}\qty{x_1^{e_1} \dots x_t^{e_t} m_i \midd 1 \leq i \leq t, e_i \geq 0, \sum_{i=1}^s k_i e_i = n - r_i} \]
and the right-hand side is a finite set.

We will make the further assumption that \( A_0 \) is Artinian.
Hence, each \( M_n \) is a finitely generated module over a ring that is both Noetherian and Artinian, so each \( M_n \) is Noetherian and Artinian as an \( A_0 \)-module.
Further, each \( M_n \) is of finite length \( \ell(M_n) < \infty \); it has a \emph{composition series} of finite length.
Note that if \( A_0 = k \) is a field, then \( \ell(M_n) = \dim_k M_n \).
\begin{definition}
    Let \( A, M \) be as above.
    Then the \emph{Poincar\'e series} of \( M \) is
    \[ P(M, T) = \sum_{n=0}^\infty \ell(M_n) T^n \in \mathbb Z\Brackets{T} \]
\end{definition}
\begin{theorem}[Hilbert--Serre theorem]
    Let \( A \) be generated by \( x_1, \dots, x_s \) as an \( A_0 \)-module with \( x_i \in A_{k_i} \) for \( k_i > 0 \).
    The Poincar\'e series \( P(M, T) \) is a rational function of the form
    \[ \frac{f(T)}{\prod_{i=1}^s (1 - T^{k_i})};\quad f \in \mathbb Z[T] \]
\end{theorem}
\begin{proof}
    For the base case \( s = 0 \), we must have \( A = A_0 \), so \( M \) is a finitely generated \( A_0 \)-module, say, \( M = \vecspan_{A_0} S \) where \( S \) is a finite subset of \( M_0 \oplus \dots \oplus M_n \).
    Thus there exists \( n_0 \) such that \( M_m = 0 \) for all \( m > n_0 \).
    In particular, \( P(M, T) \) is a polynomial.

    For the inductive step, let
    \[ M = \bigoplus_{n \in \mathbb Z} M_n;\quad M_\ell = 0 \text{ if } \ell < 0 \]
    Let \( f : M_n \to M_{n+k_s} \) be the homomorphism given by multiplication by \( x_s \).
    We obtain the exact sequence
    % https://q.uiver.app/#q=WzAsNixbMiwwLCJNX24iXSxbMywwLCJNX3tuK2tfc30iXSxbNCwwLCJMX3tuK2tfc30iXSxbNSwwLCIwIl0sWzAsMCwiMCJdLFsxLDAsIktfbiJdLFswLDEsImYiXSxbMSwyXSxbMiwzXSxbNCw1XSxbNSwwXV0=
\[\begin{tikzcd}
	0 & {K_n} & {M_n} & {M_{n+k_s}} & {L_{n+k_s}} & 0
	\arrow["f", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=1-5, to=1-6]
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
\end{tikzcd}\]
    where \( K_n = \ker f \) and \( L_{n+k_s} = \coker f \).
    Then let \( K = \bigoplus_{n \in \mathbb Z} K_n \) and \( L = \bigoplus_{n \in \mathbb Z} L_n \).
    These are graded \( A \)-modules, and \( K \) is a submodule of \( M \).
    Note that \( K \) and \( L \) are annihilated by \( x_s \).
    Applying the length function to the exact sequence, we obtain
    \[ \ell(K_n) - \ell(M_n) + \ell(M_{n+k_s}) - \ell(L_{n+k_s}) = 0 \]
    Multiplying by \( T^{n+k_s} \),
    \[ \ell(M_{n+k_s}) T^{n+k_s} - T^{k_s}\ell(M_n) T^n = \ell(L_{n+k_s}) T^{n+k_s} - T^{k_s}\ell(K_n) T^n \]
    Then, taking the sum over all integers,
    \[ P(M, T) - T^{k_s} P(M, T) = (1 - T^{k_s}) P(M, T) = P(L, T) - T^{k_s} P(K, T) \]
    By the inductive hypothesis,
    \[ (1 - T^{k_s}) P(M, T) = \frac{f_1(T)}{\prod_{i=1}^{s-1} (1 - T^{k_s})} + \frac{f_2(T)}{\prod_{i=1}^{s-1} (1 - T^{k_s})} \]
    as required.
\end{proof}
In particular, this rational function is holomorphic almost everywhere, with potentially a pole of some order at 1.
Let \( d(M) \) be the order of the pole of \( P(M, T) \) at \( T = 1 \).
One can show that if \( M \neq 0 \), then \( d(M) \geq 0 \).
\begin{example}
    Let \( A = k[T_1, \dots, T_s] = \bigoplus_{n \geq 0} A_n \) where \( A_n \) is the set of homogeneous polynomials of degree \( n \).
    Then \( A \) is generated as an \( A_0 = k \)-algebra by \( \qty{T_1, \dots, T_s} \).
    For this choice of generators, \( k_1 = \dots = k_s = 1 \).
    The length of \( A_n \) is \( \dim_k A_n = \binom{n+s-1}{n} \), which is a polynomial of degree \( s - 1 \) in \( n \) over \( \mathbb Q \).
    The Poincar\'e series of \( A \) over itself is
    \[ P(A, T) = \sum_{n \geq 0} \binom{n+s-1}{n} T^n = \frac{1}{(1 - T)^s} \]
\end{example}
\begin{proposition}
    If \( k_1 = \dots = k_s = 1 \), then there exists a \emph{Hilbert polynomial} \( HP_M \in \mathbb Q[T] \) and \( n_0 \geq 0 \) such that
    \[ \ell(M_n) = HP_M(n) \]
    for all \( n \geq n_0 \).
    In addition, \( \deg HP_M = d(M) - 1 \) where \( d(M) \) is the order of the pole of \( P(M, T) \) at \( T = 1 \).
\end{proposition}
\begin{proof}
    Let \( d = d(M) \geq 0 \).
    Then,
    \[ P(M, T) = \sum_{n \geq 0} \ell(M_n) T^n = \frac{f(T)}{(1 - T)^d};\quad f \in \mathbb Z[T], f(1) \neq 0 \]
    Let
    \[ f = \sum_{k=0}^{\deg f} a_k T^k;\quad a_k \in \mathbb Z \]
    Note that
    \[ \frac{1}{(1 - T)^d} = \sum_{j=0}^\infty \underbrace{\binom{j+d-1}{j}}_{b_j} T^j \]
    Thus, for \( n \geq \deg f \),
    \[ \ell(M_n) = \sum_{i=0}^{\deg f} a_i b_{n-i} \]
    Note that \( b_j \) is a polynomial in \( j \) over \( \mathbb Q \) of degree \( d - 1 \) with leading coefficient \( \frac{1}{(d-1)!} \).
    Then \( \ell(M_n) \) is a polynomial \( p \) in \( n \) over \( \mathbb Q \) for \( n \geq \deg f \).
    Then \( \deg p \leq d - 1 \), and the coefficient of \( T^{d-1} \) in \( p \) is
    \[ \sum_{i=0}^{\deg f} a_i \cdot \frac{1}{(d-1)!} = \frac{f(1)}{(d-1)!} \neq 0 \]
    so the degree is exactly \( d - 1 \).
\end{proof}

\subsection{Dimension theory of local Noetherian rings}
\begin{lemma}
    Let \( (A, \mathfrak m) \) be a Noetherian local ring.
    Then
    \begin{enumerate}
        \item an ideal \( \mathfrak q \) of \( A \) is \( \mathfrak m \)-primary if and only if there exists \( t \geq 1 \) such that \( \mathfrak m^t \subseteq \mathfrak q \subseteq \mathfrak m \);
        \item if \( \mathfrak q \) is \( \mathfrak m \)-primary, then \( \faktor{A}{\mathfrak q} \) is Artinian.
    \end{enumerate}
\end{lemma}
\begin{proof}
    \emph{Part (i).}
    Given an ideal \( \mathfrak q \) between \( \mathfrak m^t \) and \( \mathfrak m \), taking radicals we obtain
    \[ \sqrt{\mathfrak m^t} \subseteq \sqrt{\mathfrak q} \subseteq \sqrt{\mathfrak m} \]
    Hence \( \sqrt{\mathfrak q} = \mathfrak m \) and thus \( \mathfrak q \) is \( \mathfrak m \)-primary.
    Conversely, if \( \mathfrak q \) is \( \mathfrak m \)-primary, \( \qty(\sqrt{\mathfrak q})^t \subseteq \mathfrak q \) for some \( t \) as \( A \) is Noetherian, so \( \mathfrak m^t \subseteq \mathfrak q \subseteq \mathfrak m \) as required.

    \emph{Part (ii).}
    \( \qty(\faktor{A}{\mathfrak q}, \faktor{\mathfrak m}{\mathfrak q}) \) is a Noetherian local ring.
    If \( \mathfrak q \subseteq \mathfrak q \subseteq \mathfrak m \), then taking radicals,
    \[ \mathfrak m = \sqrt{\mathfrak q} \subseteq \mathfrak p \subseteq \mathfrak m \]
    Hence \( \mathfrak p = \mathfrak m \).
    In particular, the spectrum of \( \faktor{A}{\mathfrak q} \) is the single ideal \( \faktor{\mathfrak m}{\mathfrak q} \).
    Thus its dimension is zero, and so the quotient is Artinian.
\end{proof}
\begin{theorem}[dimension theorem]
    If \( A \) is a Noetherian local ring, then
    \[ \dim A = \delta(A) = d(G_{\mathfrak m}(A)) \]
    where \( \delta(A) = \min \qty{\delta(\mathfrak q) \mid \mathfrak q \subseteq A \text{ is } \mathfrak m \text{-primary}} \) and \( \delta(\mathfrak q) \) is the minimal number of generators of \( \mathfrak q \), and where the right-hand side is the order of the pole at \( T = 1 \) of the rational function equal to the Poincar\'e series
    \[ \sum_{n \geq 0} \ell\qty(\faktor{\mathfrak m^n}{\mathfrak m^{n+1}}) T^n \]
    of the associated graded ring.
\end{theorem}
\begin{proof}
    We will show that \( \delta \geq d \geq \dim \geq \delta \).

    Let \( \mathfrak q \) be an \( \mathfrak m \)-primary ideal of \( A \), generated by \( x_1, \dots, x_s \) where \( s = \delta(\mathfrak q) \).
    Then
    \[ G_{\mathfrak q}(A) = \faktor{A}{\mathfrak q} \oplus \faktor{\mathfrak q}{\mathfrak q^2} \oplus \oplus_{n \geq 2} \faktor{\mathfrak q^n}{\mathfrak q^{n+1}} \]
    The first factor \( \faktor{A}{\mathfrak q} \) is Artinian, and the images of \( x_1, \dots, x_s \) generate \( G_{\mathfrak q}(A) \) as an \( \faktor{A}{\mathfrak q} \)-algebra, where the \( x_i \) are of degree 1.
    Then \( \ell\qty(\faktor{\mathfrak q^n}{\mathfrak q^{n+1}}) < \infty \).
    From the theorem on Hilbert polynomials, \( \ell\qty(\faktor{\mathfrak q^n}{\mathfrak q^{n+1}}) \) is a polynomial in \( n \) of degree at most \( \delta(\mathfrak q) - 1 \), for sufficiently large \( n \).

    Fix some \( \mathfrak m \)-primary ideal \( \mathfrak q_0 \) such that \( \delta(\mathfrak q_0) = \delta(A) \).
    We consider two special cases: \( \mathfrak q = \mathfrak q_0 \) and \( \mathfrak q = \mathfrak m \).
    For \( \mathfrak q \), we have
    \[ \deg \ell\qty(\faktor{\mathfrak q_0^n}{\mathfrak q^0_{n+1}}) \leq \delta(A) - 1 \]
    As
    \[ \ell\qty(\faktor{A}{\mathfrak q_0^n}) = \sum_{i=0}^{n-1} \ell\qty(\faktor{\mathfrak q_0^i}{\mathfrak q_0^{i+1}}) \]
    we have
    \[ \deg \ell\qty(\faktor{A}{\mathfrak q_0^n}) \leq \delta(A) \]
    For \( \mathfrak m \),
    \[ \deg \ell\qty(\faktor{\mathfrak m^n}{\mathfrak m^{n+1}}) = d(G_{\mathfrak m}(A)) - 1 \]
    and hence
    \[ \deg \ell\qty(\faktor{A}{\mathfrak m^n}) = d(G_{\mathfrak m})(A) \]

    Now, there exists \( t \geq 1 \) such that \( \mathfrak m^t \subseteq \mathfrak q_0 \subseteq \mathfrak m \).
    Then
    \[ \ell\qty(\faktor{A}{\mathfrak m^n}) \leq \ell\qty(\faktor{A}{\mathfrak q_0^n}) \leq \ell\qty(\faktor{A}{\mathfrak m^{tn}}) \]
    But all of these terms are eventually polynomial, and the degrees of the left-hand and right-hand sides are the same, so we must have \( \ell\qty(\faktor{A}{\mathfrak q_0^n}) = \ell\qty(\faktor{A}{\mathfrak m^n}) \).

    \begin{proposition}
        \( \delta(A) \geq d(G_{\mathfrak m})(A) \)
    \end{proposition}
    \begin{proof}
        \[ \delta(A) = \delta(\mathfrak q_0) \geq \deg \ell\qty(\faktor{A}{\mathfrak q_0^n}) = \deg \ell\qty(\faktor{A}{\mathfrak m^n}) = d(G_{\mathfrak m}(A)) \]
    \end{proof}

    \begin{proposition}
        If \( x \in \mathfrak m \) is not a zero divisor, then
        \[ d\qty(G_{\qty(\faktor{\mathfrak m}{xA})}\qty(\faktor{A}{xA})) \leq d(G_{\mathfrak m}(A)) - 1 \]
    \end{proposition}
    This proposition allows us to prove results by induction on \( d \).
    \begin{proof}
        We have a local ring \( \qty(\faktor{A}{xA}, \faktor{\mathfrak m}{xA}) \).
        Then
        \[ d(G_{\mathfrak m}(A)) = \deg \ell\qty(\faktor{A}{\mathfrak m^n}) \]
        and
        \[ d\qty(G_{\qty(\faktor{\mathfrak m}{xA})}\qty(\faktor{A}{xA})) = \deg \ell\qty(\faktor{A/xA}{(\mathfrak m/xA)^n}) = \deg \ell\qty(\faktor{(\mathfrak m^n + xA)}{xA}) \]
        We want to show that
        \[ \deg \ell\qty(\faktor{(\mathfrak m^n + xA)}{xA}) \leq \deg \ell\qty(\faktor{A}{\mathfrak m^n}) - 1 \]
        We have the short exact sequence
        % https://q.uiver.app/#q=WzAsNSxbMiwwLCJcXGZha3RvcntBfXtcXG1hdGhmcmFrIG1ebn0iXSxbMywwLCJcXGZha3RvcntBfXsoXFxtYXRoZnJhayBtXm4gKyB4QSl9Il0sWzQsMCwiMCJdLFswLDAsIjAiXSxbMSwwLCJcXGZha3RvcnsoXFxtYXRoZnJhayBtXm4gKyB4QSl9e1xcbWF0aGZyYWsgbV5ufSJdLFswLDFdLFsxLDJdLFszLDRdLFs0LDBdXQ==
\[\begin{tikzcd}
	0 & {\faktor{(\mathfrak m^n + xA)}{\mathfrak m^n}} & {\faktor{A}{\mathfrak m^n}} & {\faktor{A}{(\mathfrak m^n + xA)}} & 0
	\arrow[from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
	\arrow[from=1-1, to=1-2]
	\arrow[from=1-2, to=1-3]
\end{tikzcd}\]
        By the second isomorphism theorem,
        \[ \faktor{(\mathfrak m^n + xA)}{\mathfrak m^n} \cong \faktor{xA}{(\mathfrak m^n \cap xA)} \]
        Thus, by additivity of length,
        \[ \ell\qty(\faktor{A}{\mathfrak m^n + xA}) = \ell\qty(\faktor{A}{\mathfrak m^n}) - \ell\qty(\faktor{xA}{(\mathfrak m^n \cap xA)}) \]
        Note that \( (\mathfrak m^n)_{n \geq 0} \) is a stable \( \mathfrak m \)-filtration of \( A \), so \( (\mathfrak m^n \cap xA)_{n \geq 0} \) is a stable \( \mathfrak m \)-filtration of the submodule \( xA \) by the Artin--Rees lemma.
        Then \( (\mathfrak m^n \cap xA)_{n \geq 0} \) is equivalent to the \( \mathfrak m \)-filtration \( (\mathfrak m^n xA)_{n \geq 0} \).
        This equivalence implies that there exists \( n_0 \) such that
        \[ \ell\qty(\faktor{xA}{(\mathfrak m^n xA)}) \leq \ell\qty(\faktor{xA}{(\mathfrak m^{n+n_0} \cap xA)});\quad \ell\qty(\faktor{xA}{(\mathfrak m^n \cap xA)}) \leq \ell\qty(\faktor{xA}{(\mathfrak m^{n+n_0} xA)}) \]
        Hence the polynomials have the same leading term, and so the degree of \( \ell\qty(\faktor{A}{\mathfrak m^n}) \) must decrease.
    \end{proof}
    \begin{proposition}
        \( d(G_{\mathfrak m}(A)) \geq \dim A \).
    \end{proposition}
    \begin{proof}
        We can prove this by induction using the previous proposition.
        % TODO: see notes
    \end{proof}
    \begin{proposition}
        \( \dim A \leq \delta(A) \).
        That is, there exists an \( \mathfrak m \)-primary ideal \( \mathfrak q \) that is generated by \( d = \dim A \) elements.
    \end{proposition}
    \begin{proof}
        As \( \mathfrak m \) is the unique maximal ideal, we must have \( \operatorname{ht}(\mathfrak m) = d \).
        Also, \( \operatorname{ht}(\mathfrak p) < d \) for any prime \( \mathfrak p \neq \mathfrak m \).
        We will form an ideal \( \mathfrak q \) generated by \( d \) elements such that \( \operatorname{ht}(\mathfrak q) \geq d \).
        This suffices, as then for every minimal prime ideal \( \mathfrak p \) of \( \mathfrak q \), we must have \( \operatorname{ht}(\mathfrak p) = d \) and thus \( \mathfrak p = \mathfrak m \), giving \( \sqrt{\mathfrak q} = \mathfrak m \) so \( \mathfrak p \) is \( \mathfrak m \)-primary as required.

        Construct \( x_1, \dots, x_d \) inductively such that \( \operatorname{ht}(\mathfrak q_i) \geq i \) where \( \mathfrak q_i = (x_1, \dots, x_i) \).
        For the base case, we take \( \mathfrak q_0 = (0) \).
        For the inductive step, we assume that \( \mathfrak q_{i-1} = (x_1, \dots, x_{i-1}) \) has already been constructed, with \( i - 1 < d \) and \( \operatorname{ht}(\mathfrak q_{i-1}) \geq i-1 \).
        We claim that there are only finitely many prime ideals \( \mathfrak p_1, \dots, \mathfrak p_t \) that contain \( \mathfrak q_{i-1} \) and have height exactly \( i-1 \).
        Indeed, \( \operatorname{ht}(\mathfrak q_{i-1}) \geq i-1 \), so each \( \mathfrak p_j \) is a minimal prime ideal of \( \mathfrak q_{i-1} \), and in a Noetherian ring, every ideal has only finitely many minimal primes.
        We know that \( i - 1 < d = \operatorname{ht}(\mathfrak m) \), so \( \mathfrak m \nsubseteq \mathfrak p_j \) for all \( j \).
        Therefore, \( \mathfrak m \nsubseteq \bigcup_j \mathfrak p_j \) by the prime avoidance lemma.
        Take \( x_i \in \mathfrak m \setminus \bigcup_j \mathfrak p_j \), and define \( \mathfrak q_i = (x_1, \dots, x_{i-1}, x_i) \).
        Now, if \( \mathfrak p \) is a prime ideal that contains \( \mathfrak q_i \), as \( \mathfrak p \notin \qty{\mathfrak p_1, \dots, \mathfrak p_t} \), we must have \( \operatorname{ht}(p) \geq i \) as required.
    \end{proof}
\end{proof}
\begin{corollary}[Krull's height theorem]
    Let \( A \) be a Noetherian ring, and let \( \mathfrak a = (x_1, \dots, x_r) \) be an ideal of \( A \).
    Let \( \mathfrak p \) be a minimal prime ideal of \( \mathfrak a \).
    Then \( \operatorname{ht}(\mathfrak p) \leq r \).
\end{corollary}
\begin{proof}
    First, we claim that \( \sqrt{\mathfrak a A_{\mathfrak p}} \) is the unique maximal ideal \( \mathfrak p A_{\mathfrak p} \) of the localisation.
    Indeed, suppose \( \mathfrak a A_{\mathfrak p} \subseteq \mathfrak n \in \Spec A_{\mathfrak p} \).
    Contracting, we obtain \( \mathfrak a \subseteq (\mathfrak a A_{\mathfrak p})^c \subseteq \mathfrak n^c \subseteq \mathfrak p \).
    But as \( \mathfrak p \) is a minimal prime ideal of \( \mathfrak a \), we must have \( \mathfrak n^c = \mathfrak p \).
    Extending, \( \mathfrak n^{ce} = \mathfrak p^e = \mathfrak p A_{\mathfrak p} \), but \( \mathfrak n^{ce} = \mathfrak n \) as required.
    Hence, \( \sqrt{\mathfrak a A_{\mathfrak p}} \) is the intersection of the primes containing it, which is just \( \mathfrak p A_{\mathfrak p} \).

    As the radical is maximal, the ideal \( \mathfrak a A_{\mathfrak p} \) is \( \mathfrak p A_{\mathfrak p} \)-primary.
    Note that \( \mathfrak a A_{\mathfrak p} = \qty(\frac{x_1}{1}, \dots, \frac{x_r}{1}) \), so by applying the dimension theorem,
    \[ \operatorname{ht}(\mathfrak p) = \dim A_{\mathfrak p} = \delta(A_{\mathfrak p}) \leq \delta(\mathfrak a A_{\mathfrak p}) \leq r \]
\end{proof}
